<!-- 首页 -->

<template>
  <div class="m_popupBox">
    <div v-if="showContent">
      <a-modal v-model="menuModalVisible" :title="$t('message.Add_commonly_used')" width="1200px" :maskClosable="false" @ok="menuModalOk"
               @cancel="menuModalCancel">
        <div class="box10">
          <div class="">
            <div class="box10_title">{{$t('message.Functions_have_been_added')}}</div>
            <div class="box10_content">
              <section class="box10_list1" style="min-height: 71px;">
                <div class="box10_item m_hoverCP" v-for="(item,index) in cacheCommonMenuList" :key="index"
                     @click="setMenu(item.title,item.path)">
                  <img class="box10_item_btnIcon" src="@assets/img/img79.png" alt=""/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon3b.png" alt=""
                       v-if="item.path === '/module_footprint/footprintHomeView/footprintHomeView'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon5b.png" alt=""
                       v-else-if="item.path === '/module_footprint/footprintProductView/footprintProductView'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon6b.png" alt=""
                       v-else-if="item.path === '/module_footprint/footprintReportView/footprintReportView'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon7b.png" alt=""
                       v-else-if="item.path === '/module_organization/userInfo'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon8b.png" alt=""
                       v-else-if="item.path === '/module_organization/role/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon9b.png" alt=""
                       v-else-if="item.path === '/module_organization/member/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon10b.png" alt=""
                       v-else-if="item.path === '/module_organization/organization/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon11b.png" alt=""
                       v-else-if="item.path === '/carbonInventory/template/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon12b.png" alt=""
                       v-else-if="item.path === '/carbonInventory/report/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon13b.png" alt=""
                       v-else-if="item.path === '/carbonInventory/kanban/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon14b.png" alt=""
                       v-else-if="item.path === '/carbonInventory/organize/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon15b.png" alt=""
                       v-else-if="item.path === '/carbonInventory/equipment/index'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon16b.png" alt=""
                       v-else-if="item.path === '/module_emission/tpfyzkView/tpfyzkView'"/>
                  <img class="box10_item_icon" src="@assets/menuIcon/menuIcon17b.png" alt=""
                       v-else-if="item.path === '/module_emission/zzyzkView/zzyzkView'"/>
                  <div class="box10_item_text" v-if="item.title == '碳足迹看板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_footprint_kanban') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_footprint_kanban') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '产品碳足迹'">
                    <div class="box10_item_text_a">{{ $t('message.Product_carbon_footprint') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Product_carbon_footprint') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '碳足迹报告'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_footprint_report') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_footprint_report') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '个人中心'">
                    <div class="box10_item_text_a">{{ $t('message.Personal_center') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Personal_center') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '角色管理'">
                    <div class="box10_item_text_a">{{ $t('message.Role_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Role_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '用户管理'">
                    <div class="box10_item_text_a">{{ $t('message.User_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.User_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '组织管理'">
                    <div class="box10_item_text_a">{{ $t('message.Organizational_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Organizational_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '碳核算模板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_accounting_template') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_accounting_template') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '碳盘查报告'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_inventory_report') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_inventory_report') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '碳盘查看板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_inventory_kanban') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_inventory_kanban') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '组织碳盘查'">
                    <div class="box10_item_text_a">{{ $t('message.Organize_carbon_inventory') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Organize_carbon_inventory') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '设施/活动管理'">
                    <div class="box10_item_text_a">{{ $t('message.Facility_event_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Facility_event_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '碳排放因子库'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_emission_factor_library') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_emission_factor_library') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="item.title == '组织因子库'">
                    <div class="box10_item_text_a">{{ $t('message.Tissue_factor_library') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Tissue_factor_library') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else>
                    <div class="box10_item_text_a">{{ item.title }}</div>
                    <div class="box10_item_text_b">{{ item.title }}</div>
                  </div>
                </div>
              </section>
            </div>
          </div>
          <div class="">
            <div class="box10_title">{{$t('message.Functions_to_be_added')}}</div>
            <div class="box10_content">
              <section v-for="(item,index) in allMenuList" :key="index">
                <div class="box10_title">{{ item.meta.title }}</div>
                <section class="box10_list1">
                  <div class="box10_item m_hoverCP" v-for="(itemA,indexA) in item.children" :key="indexA"
                       @click="setMenu(itemA.meta.title,itemA.path,itemA)">
                    <img class="box10_item_btnIcon" src="@assets/img/img76.png" alt="" v-if="itemA.select"/>
                    <img class="box10_item_btnIcon" src="@assets/img/img74.png" alt="" v-else/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon3b.png" alt=""
                         v-if="itemA.path === '/module_footprint/footprintHomeView/footprintHomeView'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon5b.png" alt=""
                         v-else-if="itemA.path === '/module_footprint/footprintProductView/footprintProductView'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon6b.png" alt=""
                         v-else-if="itemA.path === '/module_footprint/footprintReportView/footprintReportView'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon7b.png" alt=""
                         v-else-if="itemA.path === '/module_organization/userInfo'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon8b.png" alt=""
                         v-else-if="itemA.path === '/module_organization/role/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon9b.png" alt=""
                         v-else-if="itemA.path === '/module_organization/member/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon10b.png" alt=""
                         v-else-if="itemA.path === '/module_organization/organization/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon11b.png" alt=""
                         v-else-if="itemA.path === '/carbonInventory/template/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon12b.png" alt=""
                         v-else-if="itemA.path === '/carbonInventory/report/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon13b.png" alt=""
                         v-else-if="itemA.path === '/carbonInventory/kanban/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon14b.png" alt=""
                         v-else-if="itemA.path === '/carbonInventory/organize/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon15b.png" alt=""
                         v-else-if="itemA.path === '/carbonInventory/equipment/index'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon16b.png" alt=""
                         v-else-if="itemA.path === '/module_emission/tpfyzkView/tpfyzkView'"/>
                    <img class="box10_item_icon" src="@assets/menuIcon/menuIcon17b.png" alt=""
                         v-else-if="itemA.path === '/module_emission/zzyzkView/zzyzkView'"/>
                  <div class="box10_item_text" v-if="itemA.meta.title == '碳足迹看板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_footprint_kanban') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_footprint_kanban') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '产品碳足迹'">
                    <div class="box10_item_text_a">{{ $t('message.Product_carbon_footprint') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Product_carbon_footprint') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '碳足迹报告'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_footprint_report') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_footprint_report') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '个人中心'">
                    <div class="box10_item_text_a">{{ $t('message.Personal_center') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Personal_center') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '角色管理'">
                    <div class="box10_item_text_a">{{ $t('message.Role_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Role_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '用户管理'">
                    <div class="box10_item_text_a">{{ $t('message.User_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.User_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '组织管理'">
                    <div class="box10_item_text_a">{{ $t('message.Organizational_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Organizational_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '碳核算模板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_accounting_template') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_accounting_template') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '碳盘查报告'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_inventory_report') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_inventory_report') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '碳盘查看板'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_inventory_kanban') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_inventory_kanban') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '组织碳盘查'">
                    <div class="box10_item_text_a">{{ $t('message.Organize_carbon_inventory') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Organize_carbon_inventory') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '设施/活动管理'">
                    <div class="box10_item_text_a">{{ $t('message.Facility_event_management') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Facility_event_management') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '碳排放因子库'">
                    <div class="box10_item_text_a">{{ $t('message.Carbon_emission_factor_library') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Carbon_emission_factor_library') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else-if="itemA.meta.title == '组织因子库'">
                    <div class="box10_item_text_a">{{ $t('message.Tissue_factor_library') }}</div>
                    <!-- <div class="box10_item_text_b">{{ $t('message.Tissue_factor_library') }}</div> -->
                  </div>
                  <div class="box10_item_text" v-else>
                    <div class="box10_item_text_a">{{ itemA.meta.title }}</div>
                    <div class="box10_item_text_b">{{ itemA.meta.title }}</div>
                  </div>
                  </div>
                </section>
              </section>
            </div>
          </div>
        </div>
      </a-modal>
      <a-spin :spinning="loading">
        <div class="box1">
          <section class="box1_left">
            <section class="box5">
              <div class="titleBox">
                <div class="titleBox_left">{{$t('message.Common_entrance')}}</div>
                <div class="titleBox_right m_hoverCP" @click="showMenuModal">
                  {{$t('message.Edit')}} <img class="titleBox_right_img" src="@assets/img/img82.png" alt=""/>
                </div>
              </div>
              <div class="box5_list">
                <div class="box5_item m_hoverCP" v-for="(item,index) in commonMenuList" :key="index"
                     @click="onMenu(item)">
                  <template v-if="item.path">
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon3b.png" alt=""
                         v-if="item.path === '/module_footprint/footprintHomeView/footprintHomeView'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon5b.png" alt=""
                         v-else-if="item.path === '/module_footprint/footprintProductView/footprintProductView'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon6b.png" alt=""
                         v-else-if="item.path === '/module_footprint/footprintReportView/footprintReportView'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon7b.png" alt=""
                         v-else-if="item.path === '/module_organization/userInfo'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon8b.png" alt=""
                         v-else-if="item.path === '/module_organization/role/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon9b.png" alt=""
                         v-else-if="item.path === '/module_organization/member/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon10b.png" alt=""
                         v-else-if="item.path === '/module_organization/organization/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon11b.png" alt=""
                         v-else-if="item.path === '/carbonInventory/template/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon12b.png" alt=""
                         v-else-if="item.path === '/carbonInventory/report/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon13b.png" alt=""
                         v-else-if="item.path === '/carbonInventory/kanban/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon14b.png" alt=""
                         v-else-if="item.path === '/carbonInventory/organize/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon15b.png" alt=""
                         v-else-if="item.path === '/carbonInventory/equipment/index'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon16b.png" alt=""
                         v-else-if="item.path === '/module_emission/tpfyzkView/tpfyzkView'"/>
                    <img class="box5_item_img" src="@assets/menuIcon/menuIcon17b.png" alt=""
                         v-else-if="item.path === '/module_emission/zzyzkView/zzyzkView'"/>
                  </template>
                  <div class="box5_item_add" v-else>
                    <img class="box5_item_add_icon" src="@assets/img/img80.png" alt=""/>
                  </div>
                  <div class="box5_item_text" v-if="item.title == '碳足迹看板'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_footprint_kanban') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_footprint_kanban') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '产品碳足迹'">
                    <div class="box5_item_text_a">{{ $t('message.Product_carbon_footprint') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Product_carbon_footprint') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '碳足迹报告'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_footprint_report') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_footprint_report') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '个人中心'">
                    <div class="box5_item_text_a">{{ $t('message.Personal_center') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Personal_center') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '角色管理'">
                    <div class="box5_item_text_a">{{ $t('message.Role_management') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Role_management') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '用户管理'">
                    <div class="box5_item_text_a">{{ $t('message.User_management') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.User_management') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '组织管理'">
                    <div class="box5_item_text_a">{{ $t('message.Organizational_management') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Organizational_management') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '碳核算模板'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_accounting_template') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_accounting_template') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '碳盘查报告'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_inventory_report') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_inventory_report') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '碳盘查看板'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_inventory_kanban') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_inventory_kanban') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '组织碳盘查'">
                    <div class="box5_item_text_a">{{ $t('message.Organize_carbon_inventory') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Organize_carbon_inventory') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '设施/活动管理'">
                    <div class="box5_item_text_a">{{ $t('message.Facility_event_management') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Facility_event_management') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '碳排放因子库'">
                    <div class="box5_item_text_a">{{ $t('message.Carbon_emission_factor_library') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Carbon_emission_factor_library') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.title == '组织因子库'">
                    <div class="box5_item_text_a">{{ $t('message.Tissue_factor_library') }}</div>
                    <div class="box5_item_text_b">{{ $t('message.Tissue_factor_library') }}</div>
                  </div>
                  <div class="box5_item_text" v-else-if="item.path">
                    <div class="box5_item_text_a">{{ item.title }}</div>
                    <div class="box5_item_text_b">{{ item.title }}</div>
                  </div>
                  <div class="box5_item_text" v-else>
                    <div class="box5_item_text_a">{{$t('message.Add_commonly_used')}} </div>
                  </div>
                </div>
              </div>
            </section>
            <section class="box6">
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.Carbon_Inventory_Report')}}</div>
                </div>
                <div id="chart_pie_tpcbg"></div>
              </section>
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.Carbon_footprint_report')}}</div>
                </div>
                <div id="chart_pie_tzjbg"></div>
              </section>
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.Organize_carbon_inventory')}}</div>
                  <div class="titleBox_right m_hoverCP" @click="toPage('/carbonInventory/organize/index')">
                    {{$t('message.Enter_the_application')}} <img class="titleBox_right_img" src="@assets/img/img82.png" alt=""/>
                  </div>
                </div>
                <div class="carouselBox">
                  <el-carousel :autoplay="false" :interval="1000 * 10" arrow="always" height="180px"
                               @change="changeCarouselA">
                    <el-carousel-item v-for="(item,index) in getOrgAllSubjectOfCostCalcData" :key="item.id">
                      <div class="carouselBox_a_item">
                        <div class="carouselBox_a_item_left">
                          <div class="carouselBox_a_item_left_text1">{{ item.departName }}{{ item.year }}</div>
                          <div class="carouselBox_a_item_left_text2">
                            <div class="carouselBox_a_item_left_text2_a">
                              {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.total : '0' }}
                            </div>
                            <div class="carouselBox_a_item_left_text2_b">tCO₂e</div>
                          </div>
                          <div class="carouselBox_a_item_left_text3">
                            <div class="carouselBox_a_item_left_text3_a">{{$t('message.last_year')}}：</div>
                            <div class="carouselBox_a_item_left_text3_b">
                              {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.preTotal : '0' }}tCO₂e
                            </div>
                            <div class="carouselBox_a_item_left_text3_a" style="margin-left: 24px;">{{$t('message.year_on_year')}}：</div>
                            <div class="carouselBox_a_item_left_text3_c" style="color: #148958"
                                 v-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase < 0">
                              {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.increase : '' }}%
                            </div>
                            <div class="carouselBox_a_item_left_text3_c" style="color: #333333"
                                 v-else-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase == 0">
                              {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.preTotal : '' }}%
                            </div>
                            <div class="carouselBox_a_item_left_text3_c" style="color: #D54941"
                                 v-else-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase > 0">
                              {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.increase : '' }}%
                            </div>
                            <img class="carouselBox_a_item_left_text3_img" src="@assets/img/img83.png" alt=""
                                 v-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase < 0"/>
                            <span style="margin-left: 4px;transform: translateY(-3px);"
                                  v-else-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase == 0">-</span>
                            <img class="carouselBox_a_item_left_text3_img" src="@assets/img/img84.png" alt=""
                                 v-else-if="item.carbonCheckSubmitData && item.carbonCheckSubmitData.increase > 0"/></div>
                        </div>
                        <div class="carouselBox_a_item_right">
                          <div class="carouselBox_a_item_right_text1">{{$t('message.energy_using_carbon_emission')}}</div>
                          <div class="carouselBox_a_item_right_text2">
                            {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.cost : '0' }}tCO₂e
                          </div>
                          <!--                         style="margin-top: 26px;"-->
                          <div class="carouselBox_a_item_right_text1">{{$t('message.emission_reduction_measures')}}</div>
                          <div class="carouselBox_a_item_right_text2">
                            {{ item.carbonCheckSubmitData ? item.carbonCheckSubmitData.green : '0' }}tCO₂e
                          </div>
                        </div>
                      </div>
                    </el-carousel-item>
                  </el-carousel>
                </div>
              </section>
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.carbon_emission_analysis')}}</div>
                </div>
                <div id="chart_bar_tpflfx"></div>
              </section>
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.Product_carbon_footprint')}}</div>
                  <div class="titleBox_right m_hoverCP"
                       @click="toPage('/module_footprint/footprintProductView/footprintProductView')">
                       {{$t('message.Enter_the_application')}} <img class="titleBox_right_img" src="@assets/img/img82.png" alt=""/>
                  </div>
                </div>
                <div class="carouselBox">
                  <el-carousel :autoplay="false" :interval="1000 * 10" arrow="always" height="180px"
                               @change="changeCarouselB">
                    <el-carousel-item v-for="(item,index) in getCalculateCompleteListData" :key="item.productId">
                      <div class="carouselBox_b_item">
                        <div class="carouselBox_b_item_left">
                          <div class="carouselBox_b_item_left_text1">{{ item.productName }}</div>
                          <div class="carouselBox_b_item_left_text2">{{$t('message.Specifications_and_models')}}：{{ item.productSpecification }}</div>
                        </div>
                        <div class="carouselBox_b_item_right">
                          <div class="carouselBox_b_item_right_text1">{{ item.allCarbonEmission }}</div>
                          <div class="carouselBox_b_item_right_text2">kgCO₂e</div>
                        </div>
                      </div>
                    </el-carousel-item>
                  </el-carousel>
                </div>
              </section>
              <section class="box6_item">
                <div class="titleBox">
                  <div class="titleBox_left">{{$t('message.From_cradle_to_grave')}}</div>

                  <div class="titleBox_right">
                    {{
                      getCalculateCompleteListData[indexCarouselB] ? getCalculateCompleteListData[indexCarouselB].beginTime.slice(0, 10) : ""
                    }}
                    ~
                    {{
                      getCalculateCompleteListData[indexCarouselB] ? getCalculateCompleteListData[indexCarouselB].endTime.slice(0, 10) : ''
                    }}
                  </div>
                </div>
                <div class="box7">
                  <template v-if="getCalculateCompleteListData[indexCarouselB]">

                    <div class="box7_item" v-for="(item,index) in getCalculateCompleteListData[indexCarouselB].lifeData"
                         :key="index">
                      <div class="box7_item_text1">{{ item.lifeCycleTypeName }}</div>
                      <div class="box7_item_bar">
                        <div class="box7_item_bar_active" :style="{'width': item.proportion + '%'}"></div>
                      </div>
                      <div class="box7_item_text2">{{ item.proportion }}%</div>
                      <div class="box7_item_text3">{{ item.carbonEmission }}</div>
                    </div>
                  </template>
                </div>
              </section>
            </section>
          </section>
          <section class="box1_right">
            <section class="box2">
              <div class="box2_left">C</div>
              <div class="box2_right">
                <div class="box2_right_text1">{{ nickname() || '-' }}</div>
                <div class="box2_right_text2">
                  <div class="box2_right_text2_a">{{ model.name === '未注册' ? $t('message.No_data') : model.name }}</div>
                  <div class="box2_right_text2_b">{{ filterDictTextByCache("organization_state", model.state) }}</div>
                </div>
                <div class="box2_right_btn">
                  <div class="box2_right_btn_a m_hoverCP" @click="toPage('/module_organization/userInfo')">
                    <img class="box2_right_btn_a_img" src="@assets/img/img81.png" alt=""/>{{$t('message.Personal_center')}}
                  </div>
                  <div class="box2_right_btn_a m_hoverCP" @click="toPage('/module_organization/organization/index')">
                    <img class="box2_right_btn_a_img" src="@assets/img/img78.png" alt=""/>{{$t('message.enterprise_information')}}
                  </div>
                </div>
              </div>
            </section>
            <section class="box3">
              <div class="box3_title">{{$t('message.My_functional_modules')}}</div>
              <div class="box3_list">
                <div class="box3_item m_hoverCP" v-for="(item,index) in model.filterSelectModules" :key="index">
                  <img class="box3_item_img" src="@assets/menuIcon/menuIcon3b.png" alt=""
                       v-if="item.url === '/module_footprint'"/>
                  <img class="box3_item_img" src="@assets/menuIcon/menuIcon14b.png" alt=""
                       v-else-if="item.url === '/carbonInventory'"/>
                  <img class="box3_item_img" src="@assets/menuIcon/menuIcon17b.png" alt=""
                       v-else-if="item.url === '/module_emission'"/>
                  <div class="box3_item_text">
                    <div class="box3_item_text_a">{{ item.moduleName }}</div>
                    <div class="box3_item_text_b">{{ item.expire }}{{$t('message.Due_date')}}</div>
                  </div>
                </div>
              </div>
            </section>
            <section class="box4">
              <div class="box4_left">
                <div class="box4_left_tr1">{{$t('message.Contact_us')}}</div>
                <div class="box4_left_tr2">
                  <!--                <img class="box4_left_tr2_img" src="@assets/img/img72.png" alt=""/>-->
                  <div class="box4_left_tr2_text">
                    <div class="box4_left_tr2_text_a">{{$t('message.Contact_number')}}</div>
                    <div class="box4_left_tr2_text_b m_hoverCP" @click="onCopy">{{ model.contactNumber }}</div>
                  </div>
                </div>
              </div>
              <img class="box4_right" src="@assets/img/img72.png" alt=""/>
            </section>
          </section>
        </div>
      </a-spin>
    </div>
  </div>
</template>

<script>
import {getAction, postAction} from '@/api/manage'
// import RegisterOrganizeModal from './RegisterOrganizeModal.vue'
import {filterDictTextByCache} from '@/components/dict/JDictSelectUtil';
import * as echarts from "echarts";
import {cloneObject, copyText} from "@/utils/util";
import {mapGetters} from "vuex";


export default {
  name: "Analysis",
  components: {
    // RegisterOrganizeModal
  },
  data() {
    return {
      model: {},
      loading: false,
      allMenuList: [],
      menuModalVisible: false,
      commonMenuList: [],
      cacheCommonMenuList: [],
      indexCarouselA: 0,
      getOrgAllSubjectOfCostCalcData: [],
      indexCarouselB: 0,
      getCalculateCompleteListData: [],
      showContent: false, // 是否显示，管理员不显示
      lifeData : [{
        lifeCycleTypeId: "1",
        lifeCycleTypeName: this.$t('message.Raw_material_acquisition'),
        carbonEmission: 0,
        proportion: 0,
      }, {
        lifeCycleTypeId: "2",
        lifeCycleTypeName: this.$t('message.Production_manufacturing'),
        carbonEmission: 0,
        proportion: 0,
      }, {
        lifeCycleTypeId: "3",
        lifeCycleTypeName: this.$t('message.Distribution_and_storage'),
        carbonEmission: 0,
        proportion: 0,
      }, {
        lifeCycleTypeId: "4",
        lifeCycleTypeName:this.$t('message.Product_use'),
        carbonEmission: 0,
        proportion: 0,
      }, {
        lifeCycleTypeId: "5",
        lifeCycleTypeName: this.$t('message.Abandoned_disposal'),
        carbonEmission: 0,
        proportion: 0,
      }]
    }
  },
  created() {
  },
  mounted() {
    this.getOrgInfo()
  },
  methods: {
    ...mapGetters(["nickname", "avatar", "userInfo"]),
    filterDictTextByCache,
    /**
     * 复制
     */
    onCopy() {
      if (this.model.contactNumber) {
        let copyMsg = `${this.model.contactNumber}`
        copyText(copyMsg, this.$t('message.The_contact_information_has_been_copied_to_the_clipboard'))
      }
    },
    toPage(path) {
      let url = window._CONFIG['viewBaseUrl'] + path
      window.open(url, '_blank')
    },
    onMenu(item) {
      if (item.path) {
        let url = window._CONFIG['viewBaseUrl'] + item.path
        window.open(url, '_blank')
      } else {
        this.showMenuModal()
      }
    },
    setMenu(title, path, item) {
      let theIndex = this.cacheCommonMenuList.findIndex(element => element.title === title && element.path === path)
      if (theIndex > -1) {
        this.cacheCommonMenuList.splice(theIndex, 1)
        if (item) {
          // 点击带添加功能区域
          item.select = false
        } else {
          // 点击已添加功能区域
          this.allMenuList.forEach(a1 => {
            if (a1.children && a1.children.length > 0) {
              a1.children.forEach(a2 => {
                if (a2.path === path && a2.meta.title === title) {
                  a2.select = false
                }
              })
            }
          })
        }
      } else {
        if (this.cacheCommonMenuList.length < 4) {
          this.cacheCommonMenuList.push({
            "title": item.meta.title,
            "path": item.path,
          })
          item.select = true
        } else {
          this.$message.error(this.$t('message.At_most_only_four_menus_can_be_set'))
        }
      }
    },
    /**
     * 菜单设置弹窗-打开
     */
    showMenuModal() {
      this.cacheCommonMenuList = this.commonMenuList.filter(item => item.path)
      this.getAllMenu()
    },
    /**
     * 菜单设置弹窗-确定
     */
    menuModalOk(e) {
      // 菜单设置弹窗-确定
      console.log('menuModalOk', e);
      postAction('/CyHomeManage/cyHomeManage/saveData', this.cacheCommonMenuList).then((res) => {
        if (res.success) {
          this.$message.success(this.$t('message.save_success'))
          this.menuModalCancel()
          this.getCommonMenu()
        } else {
          this.$message.error(res.message)
        }
      })
    },
    /**
     * 菜单设置弹窗-关闭
     */
    menuModalCancel(e) {
      // 菜单设置弹窗-关闭
      console.log('menuModalCancel', e);
      this.menuModalVisible = false;
    },
    getData() {
      // 常用入口【菜单】
      this.getCommonMenu()
      // 碳排查报告【饼图】
      this.getCheckStatistic()
      // 碳足迹报告【饼图】
      this.getCalculateStatistics()
      // 碳组织盘查【轮播图】 / 碳排放量分析【柱状图】
      this.getOrgAllSubjectOfCostCalc()
      // 产品碳足迹【轮播图】 / 从摇篮到坟墓【进度条】
      this.getCalculateCompleteList()
    },
    /**
     * 碳组织盘查【轮播图】 / 碳排放量分析【柱状图】
     */
    async getOrgAllSubjectOfCostCalc() {
      let endData = []
      this.getOrgAllSubjectOfCostCalcData = []
      // console.time('getOrgAllSubjectOfCostCalc')
      // 获取所有核算主体
      let res = await getAction('/orgDept/getOrgAllSubjectOfCostCalc')
      if (res.success) {
        let resData = res.result || []
        for (const item of resData) {
          const index = resData.indexOf(item);
          // 获取每个核算主体最新一条组织碳盘查数据
          let resA = await getAction('/orgCheckCheck/getPageList', {
            targetId: item.id,
            pageNo: 1,
            pageSize: 1,
          })
          if (resA.success) {
            let resDataA = resA.result.records || []
            for (const itemA of resDataA) {
              const indexA = resDataA.indexOf(itemA);
              endData[index] = {
                id: item.id,
                departName: item.departName,
                year: item.year,
              }
              // 左侧轮播图数据
              let resB = await getAction('/orgCheckCheck/carbonCheckSubmitData', {
                id: itemA.id,
              })
              if (resB.success) {
                let resDataB = resB.result || {
                  "total": 0, // 碳排放量
                  "cost": 0,// 只是碳排
                  "green": 0, // 减排
                  "preTotal": 0, // 上年全部碳排
                  "increase": 0, // 同比
                }
                endData[index].carbonCheckSubmitData = resDataB
              }
              let resC = await getAction('/orgCheckCheck/carbonCheckChartLeftData', {
                id: itemA.id,
                type: 1, // 1是按类别 2是按排放源
              })
              if (resC.success) {
                let resDataC = resC.result || []
                let labelData = []
                let valueData = []
                resDataC.forEach((itemB, indexB) => {
                  labelData.push(itemB.name)
                  valueData.push(itemB.value)
                })
                endData[index].carbonCheckChartLeftData = resC.result || []
                endData[index].labelData = labelData
                endData[index].valueData = valueData
                if (index == 0) {
                  this.drawLine_tpflfx(labelData, valueData)
                }
              }
            }
          }
        }
      }
      console.log('getOrgAllSubjectOfCostCalcData', endData)
      endData = endData.filter(ele => ele)
      this.getOrgAllSubjectOfCostCalcData = endData
      // console.timeEnd('getOrgAllSubjectOfCostCalc')
    },
    getCommonMenu() {
      // 查询当前用户快捷菜单
      getAction('/CyHomeManage/cyHomeManage/getList').then((res) => {
        if (res.success) {
          let menus = []
          let resData = res.result || []
          for (let i = 0; i < (4 - resData.length); i++) {
            menus.push({})
          }
          this.commonMenuList = resData.concat(menus)
        }
      })
    },
    getAllMenu() {
      // 查询用户所有菜单权限
      getAction('/CyHomeManage/cyHomeManage/getPermission').then((res) => {
        if (res.success) {
          let resData = res.result.result.menu || []
          this.cacheCommonMenuList.forEach(a1 => {
            resData.forEach(a2 => {
              if (a2.children && a2.children.length > 0) {
                a2.children.forEach(a3 => {
                  if (a1.path === a3.path) {
                    a3.select = true
                  }
                })
              }
            })
          })
          this.allMenuList = resData
          console.log('fffffffffffffffff',this.allMenuList)
          this.menuModalVisible = true;
        }
      })
    },
    /**
     * 碳排查报告【饼图】
     */
    getCheckStatistic() {
      getAction('/orgCheckCheck/getCheckStatistic').then((res) => {
        if (res.success) {
          let pieData = [
            {name: this.$t('message.Filled_in'), value: res.result['已填报']},
            {name: this.$t('message.Filling_in'), value: res.result['填报中']},
            {name: this.$t('message.Archived'), value: res.result['已归档']}
          ]
          this.drawLine_tpcbg(pieData)
        }
      })
    },
    /**
     * 碳排查报告【饼图】
     */
    drawLine_tpcbg(valueData) {
      console.log('drawLine_tpcbg')
      let chart_pie_gx = echarts.init(
          document.getElementById('chart_pie_tpcbg')
      )
      let option = this.commonPieOption(valueData, ['#148958', '#E37318', '#333333'])
      //使用制定的配置项和数据显示图表
      chart_pie_gx.setOption(option)
    },
    /**
     * 碳足迹报告【饼图】
     */
    getCalculateStatistics() {
      getAction('/footprintProduct/cyFootprintProduct/getCalculateStatistics').then((res) => {
        if (res.success) {
          let pieData = [
            {name: this.$t('message.Accounting_has_been_created'), value: res.result.accountingTotal},
            {name: this.$t('message.Model_creation'), value: res.result.modelTotal},
            {name: this.$t('message.Accounting_completion'), value: res.result.completeTotal},
            {name: this.$t('message.Archived'), value: res.result.archivedTotal}
          ]
          this.drawLine_tzjbg(pieData)
        }
      })
    },
    /**
     * 碳足迹报告【饼图】
     */
    drawLine_tzjbg(valueData) {
      console.log('drawLine_tzjbg')
      let chart_pie_gx = echarts.init(
          document.getElementById('chart_pie_tzjbg')
      )
      let option = this.commonPieOption(valueData, ['#2c57ff', '#148958', '#E37318', '#333333'])
      //使用制定的配置项和数据显示图表
      chart_pie_gx.setOption(option)
    },
    /**
     * 饼图配置
     */
    commonPieOption(valueData, pieColorData) {
      return {
        color: pieColorData,
        legend: {
          show: true,
          icon: 'circle',
          type: 'plain',
          left: '60%',
          top: 'middle',
          formatter: function (name) {
            console.log('pie legend formatter', name)
            let value;
            valueData.forEach(item => {
              if (item.name === name) {
                value = item.value
              }
            })
            if (name === '已填报' || name === '模型创建中') {
              return `{name1|${name}}{value1|${value}}`
            } else if (name === '填报中' || name === '核算完成') {
              return `{name2|${name}}{value2|${value}}`
            } else if (name === '已归档' || name === '已归档') {
              return `{name3|${name}}{value3|${value}}`
            } else if (name === '已创建核算') {
              return `{name4|${name}}{value4|${value}}`
            } else {
              return ''
            }
          },
          textStyle: {
            rich: {
              name1: {
                // 碳排名称
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#148958',
                fontFamily: 'PingFang SC',
              },
              value1: {
                // 碳排量
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#148958',
                fontFamily: 'PingFang SC',
              },
              name2: {
                // 碳排名称
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#E37318',
                fontFamily: 'PingFang SC',
              },
              value2: {
                // 碳排量
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#E37318',
                fontFamily: 'PingFang SC',
              },
              name3: {
                // 碳排名称
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#333333',
                fontFamily: 'PingFang SC',
              },
              value3: {
                // 碳排量
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#333333',
                fontFamily: 'PingFang SC',
              },
              name4: {
                // 碳排名称
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#2c57ff',
                fontFamily: 'PingFang SC',
              },
              value4: {
                // 碳排量
                fontSize: 14,
                fontWeight: 400,
                width: 100,
                color: '#2c57ff',
                fontFamily: 'PingFang SC',
              },
            }
          },
        },
        series: [{
          type: 'pie',
          center: ['30%', '50%'], //饼图位置
          radius: ['50%', '80%'],
          avoidLabelOverlap: false,
          label: {
            normal: {
              show: false,
              position: 'center', //文字显示在中间
              align: 'center',
              verticalAlign: 'middle',
              textStyle: {
                //设置文字样式
                fontSize: '0'
              }
            },
            emphasis: {
              show: true, //文字至于中间时，这里需为true
              textStyle: {
                //设置文字样式
                fontSize: '14',
                color: 'rgba(145,213,255,0.85)'
              },
              formatter: function ({data}) {
                console.log('pie series formatter', data)
                if (data.name === '已填报' || data.name === '模型创建中') {
                  return `{value1|${data.value}}`
                } else if (data.name === '填报中' || data.name === '核算完成') {
                  return `{value2|${data.value}}`
                } else if (data.name === '已归档' || data.name === '已归档') {
                  return `{value3|${data.value}}`
                } else if (data.name === '已创建核算') {
                  return `{value4|${data.value}}`
                } else {
                  return ''
                }
              },
              //样式设置
              rich: {
                value1: {
                  // 碳排量
                  fontSize: 24,
                  fontWeight: 600,
                  color: '#148958',
                },
                value2: {
                  // 碳排量
                  fontSize: 24,
                  fontWeight: 600,
                  color: '#E37318',
                },
                value3: {
                  // 碳排量
                  fontSize: 24,
                  fontWeight: 600,
                  color: '#333333',
                },
                value4: {
                  // 碳排量
                  fontSize: 24,
                  fontWeight: 600,
                  color: '#2c57ff',
                },
              }
            }
          },
          // itemStyle: {
          //   borderRadius: 10,
          //   borderColor: '#fff',
          //   borderWidth: 5
          // },
          labelLine: {
            show: false
          },
          data: valueData
        }]
      }
    },
    /**
     * 碳排放量分析【柱状图】
     */
    drawLine_tpflfx(labelData, valueData) {
      console.log('drawLine_tpflfx')
      let chart_bar_gx = echarts.init(
          document.getElementById('chart_bar_tpflfx')
      )
      let option = this.commonBarChartOption('#F99550', labelData, valueData)
      //使用制定的配置项和数据显示图表
      chart_bar_gx.setOption(option)
    },
    /**
     * 柱状图配置项
     * @param barColor  柱状图颜色
     * @param labelData  标签
     * @param valueData  数据
     */
    commonBarChartOption(barColor, labelData, valueData) {
      return {
        grid: {
          top: 30, // 默认60
          left: '10%', // 默认10%
          right: '1%', // 默认10%
          bottom: 20, // 默认60
        },
        tooltip: {
          trigger: 'axis',
        },
        xAxis: {
          type: 'category',
          data: labelData,
          axisLabel: {  // 坐标轴刻度标签
            show: true,
            textStyle: {  // 更改x轴文字样式的配置
              color: '#777777', // 更改x轴文字颜色
            }
          },
          axisLine: { // x坐标轴轴线
            lineStyle: {
              color: '#cccccc', // x坐标轴轴线颜色
              width: 1,  // 网格线的加粗程度
              type: 'dashed' // 设置为虚线
            }
          },
          axisTick: { //坐标轴刻度
            show: false // 不显示刻度点
          }
        },
        yAxis: {
          type: 'value',
          name: '单位：tCO₂e',
          splitLine: {  // 坐标轴在grid区域中的分割线
            show: true,  // 是否显示
            lineStyle: { // 网格线样式
              color: '#cccccc', //网格线颜色
              width: 1,  //网格线的加粗程度
              type: 'dashed'    //网格线类型
            }
          },
        },
        series: [
          {
            data: valueData,
            type: 'bar',
            barWidth: 40,
            itemStyle: {
              color: barColor,
              // TODO
              borderRadius: [6, 6, 0, 0] //（顺时针左上，右上，右下，左下）

              // TODO
              // 使用回调函数根据数值大小设置圆角
              // borderRadius: function (params) {
              //   console.log('borderRadius',params)
              //   if (params.value > 0) {
              //     // 正数的圆角在上边
              //     return [6, 6, 0, 0] //（顺时针左上，右上，右下，左下）
              //   } else {
              //     // 负数的圆角在下边
              //     return [6, 6, 0, 0] //（顺时针左上，右上，右下，左下）
              //   }
              // }
            },
            tooltip: {
              valueFormatter: function (value) {
                return value + ' tCO₂e'
              }
            }
          }
        ]
      }
    },
    changeCarouselA(e) {
      console.log('changeCarouselA', e)
      this.indexCarouselA = e
      let labelData = this.getOrgAllSubjectOfCostCalcData[e].labelData
      let valueData = this.getOrgAllSubjectOfCostCalcData[e].valueData
      this.drawLine_tpflfx(labelData, valueData)
    },
    changeCarouselB(e) {
      console.log('changeCarouselB', e)
      this.indexCarouselB = e
    },
    getCalculateCompleteList() {
      // 产品碳足迹/从摇篮到坟墓
      getAction('/footprintProduct/cyFootprintProduct/getCalculateCompleteList').then((res) => {
        if (res.success) {
          let resData = res.result || []
          resData.forEach(item => {
            let allCarbonEmission = 0
            item.calculateLifeCycle.forEach(itemA => {
              allCarbonEmission = allCarbonEmission + Number(itemA.carbonEmission)
            })
            item.allCarbonEmission = allCarbonEmission
            item.calculateLifeCycle.forEach(itemA => {
              if (item.allCarbonEmission === 0) {
                itemA.proportion = 0
              } else {
                itemA.proportion = Number(((itemA.carbonEmission / item.allCarbonEmission) * 100).toFixed(2))
              }
            })
            let theLifeData = cloneObject(this.lifeData)
            theLifeData.forEach(itemA => {
              item.calculateLifeCycle.forEach(itemB => {
                if (itemA.lifeCycleTypeId == itemB.lifeCycleTypeId) {
                  itemA.carbonEmission = itemB.carbonEmission
                  itemA.proportion = itemB.proportion
                }
              })
            })
            item.lifeData = theLifeData
          })
          console.log('getCalculateCompleteListData',resData)
          this.getCalculateCompleteListData = resData
        }
      });
    },
    getOrgInfo() {
      this.loading = true
      getAction("/platform/cyPlatformOrganizationInfo/current", {}).then((res) => {
        console.log('getOrgInfo', this.userInfo())
        if (res.result) {
          if (this.userInfo().username === 'admin') {
            // 当前用户是管理员
            this.showContent = false
          } else {
            // 当前用户不是管理员
            this.showContent = true
            let aaa = ['碳排放因子库', '组织碳盘查', '产品碳足迹']
            res.result.filterSelectModules = res.result.selectModules.filter(item => aaa.includes(item.moduleName))
            this.model = res.result
            this.getData()
          }
        } else {
          this.$message.warning(this.$t('message.The_organization_is_not_registered_Please_register_as_soon_as_possible'))
        }
      }).finally(() => {
        this.loading = false
      })
    },
  },
}
</script>


<style lang="less" scoped>
.box1 {
  display: flex;
  gap: 24px;

  .box1_left {
    flex: 1;
  }

  .box1_right {
    width: 400px;
    height: 16px;
  }
}

.titleBox {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .titleBox_left {
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  .titleBox_right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #148958;
  }

  .titleBox_right_img {
    width: 16px;
    height: 16px;
  }
}

.box4 {
  margin-top: 24px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  width: 400px;
  height: 202px;
  background-image: linear-gradient(130deg, #E5F8ED 0%, #F9FDFB 100%);
  border-radius: 3px;

  .box4_left {
  }

  .box4_left_tr1 {
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  .box4_left_tr2 {
    margin-top: 38px;
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .box4_left_tr2_img {
    width: 70px;
    height: 70px;
  }

  .box4_left_tr2_text {
    flex: 1;
  }

  .box4_left_tr2_text_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #148958;
  }

  .box4_left_tr2_text_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #148958;
    line-break: anywhere;
  }

  .box4_right {
    width: 148px;
    height: 148px;
  }

}


.box3 {
  margin-top: 24px;
  box-sizing: border-box;
  padding: 24px;
  width: 400px;
  background: #FFFFFF;
  border-radius: 3px;

  .box3_title {
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  .box3_list {
  }

  .box3_item {
    margin-top: 24px;
    display: flex;
    align-items: center;
  }

  .box3_item_img {
    width: 48px;
    height: 48px;
  }

  .box3_item_text {
    margin-left: 12px;
  }

  .box3_item_text_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
  }

  .box3_item_text_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #888888;
  }
}


.box2 {
  box-sizing: border-box;
  padding: 24px;
  width: 400px;
  min-height: 274px;
  background-image: url("../../assets/img/img75.png");
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 14px;

  .box2_left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #FFFFFF;
    border-radius: 50%;
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 36px;
    color: #148958;
  }

  .box2_right {
    flex: 1;
  }

  .box2_right_text1 {
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 20px;
    color: #F5F7F6;
    line-break: anywhere;
  }

  .box2_right_text2 {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .box2_right_text2_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #F5F7F6;
    line-break: anywhere;
  }

  .box2_right_text2_b {
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #E3F9E9;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 10px;
    color: #E3F9E9;
  }

  .box2_right_btn {
    margin-top: 24px;
    display: flex;
    gap: 10px;
  }

  .box2_right_btn_a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 114px;
    height: 35px;
    background: #FFFFFF;
    border-radius: 3px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #148958;
  }

  .box2_right_btn_a_img {
    width: 16px;
    height: 16px;
  }

  .box2_right_btn_b {
  }

  .box2_right_btn_b_img {
  }

}


.box5 {
  box-sizing: border-box;
  padding: 24px;
  background: #FFFFFF;
  border-radius: 3px;

  .box5_list {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .box5_item {
    flex: 1;
    display: flex;
    align-items: center;
  }

  .box5_item_add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    //background: rgba(20, 137, 88, 0.08);
    background: #EDF6F2;
    border-radius: 6px;
  }

  .box5_item_add_icon {
    width: 24px;
    height: 24px;
  }

  .box5_item_img {
    width: 48px;
    height: 48px;
    //background: rgba(20, 137, 88, 0.08);
    border-radius: 6px;
  }

  .box5_item_text {
    margin-left: 12px;
  }

  .box5_item_text_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
  }

  .box5_item_text_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #888888;
  }
}


.box6 {
  margin-top: 24px;
  gap: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);

  .box6_item {
    box-sizing: border-box;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 3px;
  }

}

.carouselBox {
  margin-top: 24px;
  height: 180px;
}


#chart_pie_tpcbg {
  margin-top: 24px;
  width: 100%;
  height: 90px;
  //border: 1px solid red;
}

#chart_pie_tzjbg {
  margin-top: 24px;
  width: 100%;
  height: 90px;
  //border: 1px solid red;
}

#chart_bar_tpflfx {
  margin-top: 24px;
  width: 100%;
  height: 180px;
  //border: 1px solid red;
}

.carouselBox_a_item {
  box-sizing: border-box;
  padding: 24px 100px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #F0FCF7;

  .carouselBox_a_item_left {
    flex: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .carouselBox_a_item_left_text1 {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #333333;
    line-height: 28px;
    line-break: anywhere;
  }

  .carouselBox_a_item_left_text2 {
    //margin-top: 20px;
    display: flex;
    align-items: flex-end;
    line-break: anywhere;
  }

  .carouselBox_a_item_left_text2_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 38px;
    color: #148958;
  }

  .carouselBox_a_item_left_text2_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    line-height: 40px;
  }

  .carouselBox_a_item_left_text3 {
    //margin-top: 20px;
    display: flex;
    align-items: center;
    line-height: 16px;
  }

  .carouselBox_a_item_left_text3_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #888888;
  }

  .carouselBox_a_item_left_text3_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
  }

  .carouselBox_a_item_left_text3_c {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #D54941;
  }

  .carouselBox_a_item_left_text3_img {
    margin-left: 4px;
    width: 16px;
    height: 16px;
  }

  .carouselBox_a_item_right {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .carouselBox_a_item_right_text1 {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #888888;
  }

  .carouselBox_a_item_right_text2 {
    //margin-top: 17px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    line-break: anywhere;
  }
}

.carouselBox_b_item {
  box-sizing: border-box;
  padding: 24px 126px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #FFF2EA;

  .carouselBox_b_item_left {
    flex: 1;
  }

  .carouselBox_b_item_left_text1 {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #333333;
  }

  .carouselBox_b_item_left_text2 {
    margin-top: 6px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #888888;
  }

  .carouselBox_b_item_right {
    flex: 1;
  }

  .carouselBox_b_item_right_text1 {
    text-align: right;
    font-family: PingFang SC, PingFang SC;
    font-weight: 600;
    font-size: 28px;
    color: #F87B25;
  }

  .carouselBox_b_item_right_text2 {
    text-align: right;
    margin-top: 6px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #888888;
  }
}


.box7 {
  margin-top: 24px;

  .box7_item {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 13px;
  }

  .box7_item:last-child {
    margin-bottom: 0;
  }

  .box7_item_text1 {
    width: 85px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #888888;
  }

  .box7_item_bar {
    flex: 1;
    position: relative;
    height: 10px;
    background: #ECECEC;
    border-radius: 10px;
  }

  .box7_item_bar_active {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    height: 10px;
    background: #56C08D;
    border-radius: 10px;
  }

  .box7_item_text2 {
    width: 50px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #333333;
  }

  .box7_item_text3 {
    width: 100px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 16px;
    color: #333333;
  }
}


.box10 {
  .box10_title {
    margin-top: 24px;
    margin-bottom: 16px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  .box10_content {
    padding: 18px 24px;
    background: #F8F8F8;
    border-radius: 3px;
  }

  .box10_list1 {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
  }

  .box10_item {
    box-sizing: border-box;
    position: relative;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    width: 194px;
    height: 71px;
    background: #FFFFFF;
    border-radius: 3px;
  }

  .box10_item_btnIcon {
    position: absolute;
    z-index: 2;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
  }

  .box10_item_icon {
    width: 48px;
    height: 48px;
  }

  .box10_item_text {
    margin-left: 12px;
  }

  .box10_item_text_a {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #333333;
  }

  .box10_item_text_b {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #888888;
  }
}

</style>
